      $SET NOIBMCOMP
      $SET CONSTANT 32-BIT (1)
      $SET CASE
      ******************************************************************
      ***   TITEL        : DRUCKT EINE PCL5-DATEI AUF DEN DRUCKER      *
      ***                  SYNTAX "ITPCL2PR PCLFILE PRINTER-ADR DPI"   *
      ***                                                              *
      ***   NAME         : ITPCL2PR                                    *
      ***                                                              *
      ***   AUTHOR       : RAUCH                                       *
      ***                                                              *
      ***   ERSTELLT     : 04.09.2008                                  *
      ***                                                              *
      ***                                                              *
      ***                                                              *
      ******************************************************************
      *
      *
      ******************************************************************
      *
       IDENTIFICATION DIVISION.
      *
      ******************************************************************
      *
      *---------------------------*
       PROGRAM-ID. ITPCL2PR.
      *---------------------------*
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SPECIAL-NAMES.
           CALL-CONVENTION 74 IS WINAPI
           COPY SPENAMES.
      *
      *
       INPUT-OUTPUT SECTION.
      *
      *
      *
       DATA DIVISION.
      *

      ******************************************************************
      *
       WORKING-STORAGE SECTION.
      *
      ******************************************************************
           COPY WKSTD.

           COPY WKALPHAB.


       01       SPS-SCHALTER.
         05     SPS-STATUS             PIC X(01).

       01       SPH-FELDER.
         05     SPH-ACC                PIC X(256).
         05     SPH-PRINTER            PIC X(256).
         05     SPH-FELD               PIC X(32).
         05     SPH-RESOLUTION.
          10    SPH-RESOLUTION-N       PIC 9(09).

       01       VERSTAENDIGUNGSBEREICH.
           COPY YPCL2PR.

       01       FM-ARBEITSBEREICH      PIC X(2000).

           COPY DBFMON.

      ******************************************************************
      *
       PROCEDURE DIVISION.
      *
      ******************************************************************

       STEUERUNG  SECTION.
      ******************************************************************
      *
      ******************************************************************
       ST-10.
           PERFORM A-INIT.

           IF
                SPS-STATUS                      = SPACE
                PERFORM C-VERARB
           END-IF.

           PERFORM Y-NACHLAUF.
       ST-99.
      *    STOP RUN.
           COPY STOPRUN.


       A-INIT SECTION.
      ******************************************************************
      *
      ******************************************************************
       A-10.
           MOVE SPACE                          TO SPS-STATUS
                                                  SPH-FELDER
           INITIALIZE                             YPCL2PRVB.

           ACCEPT SPH-ACC                    FROM COMMAND-LINE


           IF
                SPH-ACC                         = "STD"
                MOVE "D:\INTEX.ENT\INTEX\DRUCKE\INTEX.23202"
                                               TO SPH-ACC
                MOVE "q:\INTEX.ENT\INTEX\DRUCKE\karen.899"
                                               TO SPH-ACC
                MOVE "d:\INTEX.ENT\INTEX\DRUCKE\karen.920"
                                               TO SPH-ACC
                MOVE "t:\chin\sophie.343"
                                               TO SPH-ACC
                MOVE "\\WSXP-MRAUCH\HPOFFICE"  TO SPH-ACC (39:)
      *!!!!     MOVE "600"                     TO SPH-ACC (62:)
           END-IF


           UNSTRING SPH-ACC             DELIMITED BY ALL " "
                                             INTO YPCL2PR-DATEI
                                                  YPCL2PR-PRINTER
                                                  SPH-RESOLUTION

           IF
                YPCL2PR-DATEI                   = SPACE
                DISPLAY "syntax: itpcl2pr PCL-file printeraddress DPI"
                MOVE WKA-ENDE                  TO SPS-STATUS
           END-IF

           IF
                YPCL2PR-PRINTER                 = SPACE
                MOVE "\\vm2k8-dc01\hplj4250"   TO YPCL2PR-PRINTER
           END-IF.

           IF
                SPH-RESOLUTION              NOT = SPACE
                PERFORM 9 TIMES
                   IF
                        SPH-RESOLUTION (9:1)    = SPACE
                        MOVE SPH-RESOLUTION    TO SPH-FELD
                        MOVE SPH-FELD          TO SPH-RESOLUTION (2:)
                        MOVE "0"               TO SPH-RESOLUTION (1:1)
                   END-IF
                END-PERFORM
                IF
                     SPH-RESOLUTION         NOT   NUMERIC
                     DISPLAY "DPI not numeric!"
                     MOVE WKA-ENDE             TO SPS-STATUS
                     MOVE ZERO                 TO SPH-RESOLUTION-N
                END-IF
           ELSE
                MOVE ZERO                      TO SPH-RESOLUTION-N
           END-IF.
           MOVE SPH-RESOLUTION-N               TO YPCL2PR-RESOLUTION.
       A-99.
           EXIT.


       C-VERARB SECTION.
      ******************************************************************
      * CALL AUFS MODUL
      * ACHTUNG: KEIN ITCACHE, DA DAS ZEUG AUCH OHNE RUNTIME FUER
      * AS4-KUNDEN FUNKTIONIEREN SOLL!!!!!
      ******************************************************************
       C-10.
           SET  YPCL2PR-FKT-DRUCKEN            TO TRUE.


           CALL "YPCL2PR"                   USING YPCL2PRVB
                                                  FM-ARBEITSBEREICH
                                                  DB-FELDER
           .
       C-99.
           EXIT.


       Y-NACHLAUF SECTION.
      ******************************************************************
      * CLOSE DATEI
      ******************************************************************
       Y-10.

       Y-99.
           EXIT.
